//引入movie常量
import { MOVIELIST } from '../constant/movieConst'

//定义moviereducer初始值
const init = {
  movielist: []
}

export default function movieReducer(prevStata = init, action) {
  //console.log(action,'action');
  const { type, data } = action
  switch (type) {
    case MOVIELIST:
      return {
        ...prevStata,
        movielist: data
      }
  }

  //返回一个对象
  return prevStata
}